package p270jp.pxv.android.viewholder;

import android.view.View;
import java.util.List;
import p014ae.View$OnClickListenerC0156s7;
import p045be.View$OnLongClickListenerC1066e1;
import p134ei.AnalyticsAreaName;
import p134ei.AnalyticsScreenName;
import p165fo.C3114c;
import p184gi.AnalyticsParameter;
import p184gi.ClickEvent;
import p270jp.pxv.android.R;
import p270jp.pxv.android.event.ShowWorkMenuOnLongClickEvent;
import p270jp.pxv.android.legacy.event.ShowNovelDetailDialogEvent;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.view.NovelItemView;
import p451qm.NeedsNovelItemDecoration;

/* renamed from: jp.pxv.android.viewholder.NovelItemViewHolder */
/* loaded from: classes2.dex */
public class NovelItemViewHolder extends BaseViewHolder implements NeedsNovelItemDecoration {
    public NovelItemView novelItemView;

    /* renamed from: jp.pxv.android.viewholder.NovelItemViewHolder$NovelItem */
    /* loaded from: classes2.dex */
    public static class NovelItem {
        private List<PixivNovel> allNovelList;
        private AnalyticsAreaName areaName;
        private boolean ignoreIsMuted;
        private int position;
        private final Long screenId;
        private AnalyticsScreenName screenName;

        public NovelItem(List<PixivNovel> list, int i, boolean z, AnalyticsScreenName cVar, AnalyticsAreaName bVar, Long l) {
            this.ignoreIsMuted = false;
            this.allNovelList = list;
            this.position = i;
            this.ignoreIsMuted = z;
            this.screenName = cVar;
            this.areaName = bVar;
            this.screenId = l;
        }

        public ClickEvent getClickEvent() {
            return new ClickEvent(21, Long.valueOf(getTarget().f19079id), Long.valueOf(getTarget().f19079id), Integer.valueOf(this.position), this.screenName, this.screenId, this.areaName, null, null);
        }

        public boolean getIgnoreIsMuted() {
            return this.ignoreIsMuted;
        }

        public int getPosition() {
            return this.position;
        }

        public Long getScreenId() {
            return this.screenId;
        }

        public AnalyticsScreenName getScreenName() {
            return this.screenName;
        }

        public ClickEvent getSeriesClickEvent() {
            if (getTarget().series != null) {
                return new ClickEvent(23, Long.valueOf(getTarget().series.f19077id), Long.valueOf(getTarget().f19079id), Integer.valueOf(this.position), this.screenName, this.screenId, this.areaName, null, null);
            }
            return null;
        }

        public PixivNovel getTarget() {
            return this.allNovelList.get(this.position);
        }

        public ClickEvent getViewMoreClickEvent() {
            return new ClickEvent(22, Long.valueOf(getTarget().f19079id), Long.valueOf(getTarget().f19079id), Integer.valueOf(this.position), this.screenName, this.screenId, this.areaName, null, null);
        }
    }

    public NovelItemViewHolder(View view) {
        super(view);
        this.novelItemView = (NovelItemView) view;
    }

    /* renamed from: d */
    public static /* synthetic */ void m4415d(PixivNovel pixivNovel, NovelItem novelItem, View view) {
        lambda$bind$0(pixivNovel, novelItem, view);
    }

    public static int getLayoutRes() {
        return R.layout.view_holder_novel_item;
    }

    public static /* synthetic */ void lambda$bind$0(PixivNovel pixivNovel, NovelItem novelItem, View view) {
        C3114c.m6284b().m6280f(new ShowNovelDetailDialogEvent(pixivNovel, null, novelItem.screenName, novelItem.screenId));
    }

    public static /* synthetic */ boolean lambda$bind$1(PixivNovel pixivNovel, View view) {
        C3114c.m6284b().m6280f(new ShowWorkMenuOnLongClickEvent(pixivNovel));
        return true;
    }

    @Override // p270jp.pxv.android.viewholder.BaseViewHolder
    public void bind(Object obj) {
        super.bind(obj);
        NovelItem novelItem = (NovelItem) obj;
        PixivNovel target = novelItem.getTarget();
        this.novelItemView.setIgnoreMuted(novelItem.getIgnoreIsMuted());
        this.novelItemView.setNovel(target);
        this.novelItemView.setWorkForLikeButton(target);
        this.novelItemView.setAnalyticsParameter(new AnalyticsParameter(novelItem.getScreenName(), null, 0));
        this.novelItemView.setOnClickListener(new View$OnClickListenerC0156s7(target, novelItem, 8));
        this.novelItemView.setOnLongClickListener(new View$OnLongClickListenerC1066e1(target, 2));
    }
}
